<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
    <title>在线医疗管理系统</title>
    <link href="bootstrap-4.6.1-dist/css/bootstrap.min.css"
          rel="stylesheet" type="text/css">
    <style type="text/css">
        body{
            width:100%;
            height:100%;
            background:url(img/1.jpg);
            background-repeat: no-repeat;
            background-size:100% 100%;
            background-attachment:fixed;
        }

        #main{
            margin-top:200px;
            margin-left: 500px;
            margin-right: 500px;
            background-color: rgba(240, 240, 240, 0.3);
            padding-top:40px;
            padding-bottom: 30px;
            padding-left: 60px;
            padding-right: 30px;
            box-sizing:border-box;
        }
        .font{
            font-family: 楷体;
            font-weight: 700;
            font-size:25px;
        }
    </style>
</head>
<body>
<div id="main">
 <form id="form">
        <div class="form-group row">
            <label class="col-form-label col-3"></label>
            <div class="font">在线医疗管理系统</div>

        </div>
        <div class="form-group row">
            <label class="col-form-label col-2 text-center">账号:</label>
            <div class="col-8">
                <input type="text" id="loginName" name="loginName" value="" class="form-control">
            </div>
        </div>
        <div class="form-group row">
            <label class="col-form-label col-2 text-center">密码：</label>
            <div class="col-8">
                <input type="password" id="loginPwd" name="loginPwd" value="" class="form-control">
            </div>
        </div>
        <div class="form-group row">
            <label class="col-form-label col-2"></label>
            <div class="col-8">
                <button type="button" id="btnLogin" class="btn btn-lg btn-success">登录</button>

                <a href="http://localhost:8088/demo/reg.html">请先注册</a>
                <a href="http://localhost:8088/demo/userFindPassword.html">忘记密码</a>
            </div>

        </div>
    </form>

</div>
</body>
<script src="jQuery/jquery-3.6.0.min.js"></script>
<script>
     jQuery(function () {
         jQuery("#btnLogin").click(function () {

             let form = jQuery("#form").serialize();

             jQuery.post("user/search", form, function (rst) {
                 if(rst.length>0){
                 alert("登录成功！");
                     window.location.href="Doctor.html";
                 }
                 else
                 {
                     alert("账号或密码错误！");
                 }
             });
         });
     })


</script>
</html>
